	<div class="content page-cart">
		<ul class="menu">
			<li class="current"><a href="/cart.html">Mon panier d’achat</a></li>
			<li><a href="/payment.html">Paiement</a></li>
			<li class="back"><a href="/">Retour au site</a></li>
		</ul>
		<div class="introduce">
			<img src="/assets/images/shopping-cart.gif" align="left" alt="cart"/>
			<p>Comme vous le savez, les arbres ont de multiples vertus !  En plantant un arbre, vous contribuez à la fois à la lutte aux changements climatiques, à  l’amélioration de la qualité de vie, à la purification de l’air, ainsi qu’au financement des activités de Projets Citoyens Québec. </p>
		</div>
		<div class="clear"></div>
		<?php
		if (isset($_REQUEST["loai"]))
		{
			foreach($_SESSION["giohang"] as $key=>$value)
			{	
				if ( $key == $_REQUEST["loai"])
					unset($_SESSION["giohang"][$key]);		
			}	
		} 
		if(isset($_POST['check']))
		{
			foreach( $_SESSION["giohang"] as $key=>$value  )
			{		
				if(isset($_POST[$key])) {
					if(check_number($_POST["sl_".$key]))
						$_SESSION["giohang"][$key][1]=(int)($_POST["sl_".$key]);
					else
						echo '<p class="empty mess-error">This value should be a valid number</p>';
				}
			}
		}
		?>
		<form name="form1" method="post" action="">
		
		  <?php
			if(isset($_SESSION['giohang']) && $_SESSION['giohang']!=NULL)
			{?>
				<table border="0">
				  <tr>
					<th width="500">Items</th>
					<th>Quantité </th>
					<th>Montant</th>
				  </tr>
				<?php
				foreach($_SESSION['giohang'] as $k=>$gt)
				{
				?>
				<tr>
					<td><?php echo chooseName($gt[0])?></td>
					<td>
					  <label for="textfield"></label>
					  <input type="text" name="sl_<?php echo $k;?>" id="<?php echo $k;?>" class="txt_qty" value="<?php echo $gt[1]?>">
					  <input type="submit" name="<?php echo $k?>" value="mettre à jour" class="sub_edit"/>
					</td>
					<td class="price-cart"><?php echo format($gt[2]*$gt[1]);?> <a href="/cart/<?php echo $gt[0];?>"><img src="/assets/images/icon_delete.png" align="right" alt="icon delete" onclick="return xoa();"/></a></td>
				</tr>
				<?php
				}
				?>
				<tr>
					<td rowspan="5">&nbsp;</td>
					<td class="result">SOUS-TOTAL</td>
					<td class="result-number"><?php echo subtotal();?>$</td>
				</tr>
				<tr>
					<td class="result">TPS</td>
					<td class="result-number">25.00$</td>
				</tr>
				<tr>
					<td class="result">TVQ</td>
					<td class="result-number">29.00$</td>
				</tr>
				  <tr>
					<td class="result">Frais de livraison</td>
					<td class="result-number">5.00$</td>
				</tr>
				  <tr>
					<td class="result sum-total">TOTAL</td>
					<td class="result-number sum-total"><?php echo sumTotal();?>$</td>
				  </tr>
				</table>
				<input type="hidden" name="check" value=""/>
				<input type="button" name="btn_continue" class="btn btn-continue btn-pay" value="Paiement &gt;" onclick="location.href='/payment.html'"/>
				<?php
			}
			else
			{
				echo '<p class="empty">Votre panier est vide.</p>';
			}
		  ?>
		</form>	
	</div>
	<!-- end content -->


